const EventApp = () =>{
  const handler = (e) =>{
    e.preventDefault(); // 取消默认行为
    e.stopPropagation(); // 取消事件的冒泡
    alert('You clicked')
  }

  return <div>
    <button onClick={()=>{alert(123)}}>点击1</button>
    <button onClick={handler}>点击2</button>
  </div>
}

export default EventApp